﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace TetrisService
{
    /// <summary>
    /// This class holds the configuration of the game. In addition, it is also used to pass the 
    /// game configuration between the server and the client when the game starts.
    /// </summary>
    [Serializable]
    public class GameConfiguration
    {
        public int numColumns;
        public int numRows;
        public int numColumnsNextTetromino;
        public int numRowsNextTetromino;
        public int refreshTime;
        public int[] myBestScores;
        public string[] bestScores;

        /// <summary>
        /// Initializes a new instance of the <see cref="GameConfiguration"/> class.
        /// </summary>
        public GameConfiguration() { }

        /// <summary>
        /// Gets or sets the number of columns.
        /// </summary>
        /// <value>
        /// The number of columns.
        /// </value>
        public int NumColumns
        {
            get { return numColumns; }
            set { numColumns = value; }
        }

        /// <summary>
        /// Gets or sets the number of rows.
        /// </summary>
        /// <value>
        /// The number of rows.
        /// </value>
        public int NumRows
        {
            get { return numRows; }
            set { numRows = value; }
        }

        /// <summary>
        /// Gets or sets the number of columns of the space that is showing the next tetromino.
        /// </summary>
        /// <value>
        /// The number of columns of the place that is showing the next tetromino.
        /// </value>
        public int NumColumnsNextTetromino
        {
            get { return numColumnsNextTetromino; }
            set { numColumnsNextTetromino = value; }
        }

        /// <summary>
        /// Gets or sets the number of rows of the space that is showing the next tetromino.
        /// </summary>
        /// <value>
        /// The number of rows of the place that is showing the next tetromino.
        /// </value>
        public int NumRowsNextTetromino
        {
            get { return numRowsNextTetromino; }
            set { numRowsNextTetromino = value; }
        }

        /// <summary>
        /// In this context, refresh time means the gravity of the game. The lower the
        /// refresh time is, the faster the pieces will go down.
        /// </summary>
        /// <value>
        /// The refresh time.
        /// </value>
        public int RefreshTime
        {
            get { return refreshTime; }
            set { refreshTime = value; }
        }

        /// <summary>
        /// Gets or sets my best scores.
        /// </summary>
        /// <value>
        /// My best scores.
        /// </value>
        public int[] MyBestScores
        {
            get { return myBestScores; }
            set { myBestScores = value; }
        }

        /// <summary>
        /// Gets or sets the best scores.
        /// </summary>
        /// <value>
        /// The best scores.
        /// </value>
        public string[] BestScores
        {
            get { return bestScores; }
            set { bestScores = value; }
        }
    }
}